﻿#define _CRT_SECURE_NO_WARNINGS//模拟实现memcpy
#include<stdio.h>
#include<string.h>
void* my_memcpy(void* dest, void* src, size_t num)
{
	void* ret = dest;
	while (num--)
	{
		*(char*)dest = *(char*)src;
		dest = ((char*)dest + 1);
		src = ((char*)src + 1);
	}
	return ret;
}
int main()
{
	int arr1[20] = { 1,2,3,4,5 };
	int arr2[] = { 2,3,4,5,6,7 };
	/*memcpy(arr1, arr2, 8);*/
	my_memcpy(arr1, arr2, 8);
	for (int i = 0; i < 20; i++)
	{
		printf("%d\n", arr1[i]);
	}

	return 0;
}